package com.xiaolin.structure.queue.linked.doubleend;

/**
 * @ClassName DemoQueueTest
 * @Description 描述
 * @Detail detail
 * @Author MyPC
 * @Date 2020/12/13
 * @Version 1.0
 */
public class DemoQueueTest {
    public static void main(String[] args) {
        DemoQueue<Person> demoQueue=new DemoQueue<>();
        demoQueue.addLast(new Person(1));
        System.out.println(demoQueue.getFront().age);
        System.out.println(demoQueue.getRear().age);
        demoQueue.addLast(new Person(2));
        demoQueue.addLast(new Person(3));
        System.out.println(demoQueue.size());
        demoQueue.removeFirst();
        demoQueue.removeFirst();
        demoQueue.removeFirst();
        System.out.println(demoQueue.size());
        demoQueue.addFirst(new Person(4));
        demoQueue.addFirst(new Person(5));
        System.out.println(demoQueue.size());
        demoQueue.removeLast();
        demoQueue.removeLast();
        System.out.println(demoQueue.size());
    }

    /**
     * @ClassName Person
     * @Description TODO
     * @Detail detail
     * @Author MyPC
     * @Date 2020/11/7
     * @Version 1.0
     */
    public static class Person {
        private int age;
        public Person(int age){
            this.age=age;
        }

        public int getAge() {
            return age;
        }
    }
}
